<%--
    Document   : displayResultMessage
    Created on : May 10, 2014, 6:57:49 PM
    Author     : Anton Strack
--%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@tag description="Display the result message according to it's message type." pageEncoding="UTF-8"%>
<%@ variable name-given="css_class"%>

<c:if test="${requestResultMessage != null}">
    <c:choose>
        <c:when test="${requestResultMessageType == 'info'}">
            <c:set var="css_class">
                alert-info
            </c:set>
        </c:when>
        <c:when test="${requestResultMessageType == 'error'}">
            <c:set var="css_class">
                alert-danger
            </c:set>
        </c:when>
        <c:when test="${requestResultMessageType == 'warning'}">
            <c:set var="css_class">
                alert-warning
            </c:set>
        </c:when>
        <c:when test="${requestResultMessageType == 'success'}">
            <c:set var="css_class">
                alert-success
            </c:set>
        </c:when>
        <c:otherwise>
            <c:set var="css_class">
                alert-info
            </c:set>
        </c:otherwise>
    </c:choose>
    <div class="alert alert-dismissable ${css_class}">
        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
        <p>${requestResultMessage}</p>
    </div>
</c:if>